package com.android.aircondition.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

import com.android.aircondition.R;
import com.android.aircondition.common.NetListAdapter;

public class NetWorkActivity extends BaseActivity{
	
	
	   /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.net);
        super.setCommonTitle(this, R.string.title_network);
    }
   
    @Override
    protected void onResume() {
    	super.onResume();
    	setViews();
    }
    
    private void setViews(){
    	
    	ListView netListView = (ListView)findViewById(R.id.networkListView);
    	NetListAdapter adapter = new NetListAdapter(this);
    	netListView.setAdapter(adapter);
    	netListView.setOnItemClickListener(new OnItemClickListener() {
    		@Override
    		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
    				long arg3) {
    			Intent intent = new Intent(NetWorkActivity.this,SettingAirconditionActivity.class);
				NetWorkActivity.this.startActivity(intent);
    			
    		}
		});
    	
    	Button netMobileBtn = (Button)findViewById(R.id.network_MobileButton);
    	netMobileBtn.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
			
				Intent intent = new Intent(NetWorkActivity.this,SettingMobileActivity.class);
				NetWorkActivity.this.startActivity(intent);
				
			}
		});


    }
    
   
}
